View Javadoc

1   // Class.java, created Fri Apr  5 18:36:41 2002 by joewhaley
2   // Copyright (C) 2001-3 John Whaley <jwhaley@alum.mit.edu>
3   // Licensed under the terms of the GNU LGPL; see COPYING for details.
4   package joeq.ClassLib.sun14_win32.java.lang;
5   
6   /*
7    * @author  John Whaley <jwhaley@alum.mit.edu>
8    * @version $Id: Class.java 1451 2004-03-09 06:27:08Z jwhaley $
9    */
10  public final class Class {
11      
12      private native java.lang.reflect.Field[] getFields0(int m);
13      private native java.lang.reflect.Method[] getMethods0(int m);
14      private native java.lang.reflect.Constructor[] getConstructors0(int m);
15      
16      private java.lang.reflect.Field[] getDeclaredFields0(boolean publicOnly) {
17          java.lang.reflect.Field[] f = getFields0(java.lang.reflect.Member.DECLARED);
18          if (publicOnly) {
19              int count = 0;
20              for (int i=0; i<f.length; ++i) {
21                  if (java.lang.reflect.Modifier.isPublic(f[i].getModifiers()))
22                      ++count;
23              }
24              java.lang.reflect.Field[] f2 = new java.lang.reflect.Field[count];
25              --count;
26              for (int i=0, j=-1; j<count; ++i) {
27                  if (java.lang.reflect.Modifier.isPublic(f[i].getModifiers()))
28                      f2[++j] = f[i];
29              }
30              f = f2;
31          }
32          return f;
33      }
34      private java.lang.reflect.Method[] getDeclaredMethods0(boolean publicOnly) {
35          java.lang.reflect.Method[] f = getMethods0(java.lang.reflect.Member.DECLARED);
36          if (publicOnly) {
37              // TODO.
38          }
39          return f;
40      }
41      private java.lang.reflect.Constructor[] getDeclaredConstructors0(boolean publicOnly) {
42          java.lang.reflect.Constructor[] f = getConstructors0(java.lang.reflect.Member.DECLARED);
43          if (publicOnly) {
44              // TODO.
45          }
46          return f;
47      }
48      
49      private static boolean desiredAssertionStatus0(Class clazz) {
50          // TODO.
51          return false;
52      }
53  }